﻿using Admin.NET.Core;
using MOKA.TPM.Application.Enum;
using MOKA.TPM.Entity;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （数据字典明细）
/// </summary>
public class SysDictDetailOutput : SysDictDetail
{
    /// <summary>
    /// 父项 （字典名称）
    /// </summary>
    public string? ItemParentName { get; set; }

    public string CatCode { get; set; } = string.Empty;
    public string CatName { get; set; } = string.Empty;

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class SysDictDetailInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 字典目录
    /// </summary>
    public Guid? DictCodeID { get; set; }  //唯一索引

    /// <summary>
    /// 父项
    /// </summary>
    public Guid? ItemParent { get; set; }  //唯一索引

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    public string? ItemValue { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetSysDictDetailInput : BaseOrderInput
{
    /// <summary>
    /// 字典目录
    /// </summary>
    public Guid? DictCodeID { get; set; }  //唯一索引

    /// <summary>
    /// 父项
    /// </summary>
    public Guid? ItemParent { get; set; }  //唯一索引

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    public string? ItemValue { get; set; }  //唯一索引

    /// <summary>
    /// 状态
    /// </summary>
    [SugarColumn(ColumnName = "Status", ColumnDescription = "状态")]
    public TpmStatusEnum? Status { get; set; }
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PageSysDictDetailInput : BasePageInput
{
    /// <summary>
    /// 字典目录
    /// </summary>
    public Guid? DictCodeID { get; set; }  //唯一索引

    /// <summary>
    /// 父项
    /// </summary>
    public Guid? ItemParent { get; set; }  //唯一索引

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    public string? ItemValue { get; set; }  //唯一索引

    /// <summary>
    /// 项目名称
    /// </summary>
    [Required, MaxLength(200)]
    public string? ItemName { get; set; } = string.Empty;
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddSysDictDetailInput
{
    /// <summary>
    /// 字典目录
    /// </summary>
    public Guid? DictCodeID { get; set; }

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    [Required, MaxLength(50)]
    public string ItemValue { get; set; } = string.Empty;

    /// <summary>
    /// 项目名称
    /// </summary>
    [Required, MaxLength(200)]
    public string ItemName { get; set; } = string.Empty;

    /// <summary>
    /// 附加名称2
    /// </summary>
    [MaxLength(200)]
    public string? ItemName2 { get; set; }

    /// <summary>
    /// 附加名称3
    /// </summary>
    [MaxLength(200)]
    public string? ItemName3 { get; set; }

    /// <summary>
    /// 附加名称4
    /// </summary>
    [MaxLength(200)]
    public string? ItemName4 { get; set; }

    /// <summary>
    /// 项名备注
    /// </summary>
    [MaxLength(30)]
    public string? ItemRemark { get; set; }

    /// <summary>
    /// 排序序号
    /// </summary>
    public int FNOrder { get; set; }

    /// <summary>
    /// 父项
    /// </summary>
    public Guid? ItemParent { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public TpmStatusEnum Status { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(20)]
    public string? CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdateSysDictDetailInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 字典目录
    /// </summary>
    public Guid? DictCodeID { get; set; }

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    [MaxLength(50)]
    public string ItemValue { get; set; }

    /// <summary>
    /// 项目名称
    /// </summary>
    [MaxLength(200)]
    public string ItemName { get; set; }

    /// <summary>
    /// 附加名称2
    /// </summary>
    [MaxLength(200)]
    public string? ItemName2 { get; set; }

    /// <summary>
    /// 附加名称3
    /// </summary>
    [MaxLength(200)]
    public string? ItemName3 { get; set; }

    /// <summary>
    /// 附加名称4
    /// </summary>
    [MaxLength(200)]
    public string? ItemName4 { get; set; }

    /// <summary>
    /// 项名备注
    /// </summary>
    [MaxLength(30)]
    public string? ItemRemark { get; set; }

    /// <summary>
    /// 排序序号
    /// </summary>
    public int FNOrder { get; set; }

    /// <summary>
    /// 父项
    /// </summary>
    public Guid? ItemParent { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public TpmStatusEnum Status { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(20)]
    public string? CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// 子表：数据字典明细 </summary>
    public List<SysDictDetail> SysDictDetails { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeleteSysDictDetailInput
{
    /// <summary> 主键Id </summary> </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomeSysDictDetailInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 字典目录
    /// </summary>
    public string? DictCodeID { get; set; }  //唯一索引

    /// <summary>
    /// 父项
    /// </summary>
    public string? ItemParent { get; set; }  //唯一索引

    /// <summary>
    /// 项目值（代码）
    /// </summary>
    public string? ItemValue { get; set; }  //唯一索引

    /// <summary>
    /// 状态
    /// </summary>
    public TpmStatusEnum Status { get; set; }
}